from django.db import models

class Hotel(models.Model):
	name = models.CharField(max_length=100)
	description = models.TextField(null=True)
	city = models.CharField(max_length=100)
	region = models.CharField(max_length=100)
	
	def __unicode__(self):
		return self.name

class HotelImage(models.Model):
	hotel = models.ForeignKey(Hotel)
	image = models.ImageField(upload_to="static/hotel_image")

	def __unicode__(self):
		return self.hotel.name

class Room(models.Model):
	hotel = models.ForeignKey(Hotel)
	name = models.CharField(max_length=100)
	price = models.DecimalField(max_digits=10, decimal_places=2)
	number_perosns = models.IntegerField("Number Of Persons")
	number_rooms = models.IntegerField("Number Rooms")
	
	def __unicode__(self):
		return self.name

class RoomImage(models.Model):
	room = models.ForeignKey(Room)
	image = models.ImageField(upload_to="static/room_image")

	def __unicode__(self):
		return self.room.name
	
